<td width="564" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<form name="f1" method="post" action="">
<table width="600" cellpadding="2" cellspacing="2">
	<tr>
		
		
		<td width="100"><b>Product</b></td>
		<td width="100"><b>Rate</b></td>
		<td width="100"><b>Tax</b></td>
		<td width="100"><b>Discount</b></td>
		<td width="100"><b>Date</b></td>
		<td width="100"><b>Price</b></td>
	</tr>

</table><!--
$dcpath = IMAGE_PATH . 'images/' . $payment['docpath'];
IMAGE_PATH-->
<table>
	<?php if (!empty($purchase)): ?>
				
				<?php foreach ($purchase as $payment): ?>
				<?php $olddate = $payment['salesdate'];
					$newdata = date("d-M-Y",strtotime($olddate));
					//$docpath = $payment['docpath'];
					$dcpath = IMAGE_PAT . 'images/' . $payment['docpath'];
					$rate1 = $payment['rate'];
					$tax1 = $payment['tax1'];
					$tax2 = $payment['tax2'];
					$tax = $tax1+$tax2;
					$discount = $payment['discount_amt'];
					$price = ($rate1+$tax) - $discount;
					
				?>	
					
					<tr width="600">
					
						<td width="100" class="fonttext"><?php print $payment['productname'];?></td>
						<td width="100" class="fonttext"><?php print $payment['rate'];?></td>
						<td width="100" class="fonttext"><?php echo $tax;?></td>
						<td width="100" class="fonttext"><?php print $payment['discount_amt'];?></td>
						
						<td width="100" class="fonttext"><?php echo $newdata; ?></td>
						<td width="100" class="fonttext"><?php echo $price; ?></td>
						<td width="100" class="fonttext">
						<?php if(!file_exists($dcpath)){?>download<?php }else{?>
						
						<a href="<?php echo $dcpath;?>">download</a><?php }?></td>
						
						
					</tr>
			<?php endforeach; ?>
			<?php endif; ?>
</table>
</form>
            </table></td>

<td width="210" align="left" valign="top">
<?php $this->load->view('layout/rightsidebarreg.php');?>
</td></tr></table>
          